package com.cs.widgetrv.adapter;

import com.chad.library.adapter.base.BaseSectionQuickAdapter;
import com.chad.library.adapter.base.entity.JSectionEntity;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.cs.widgetrv.R;
import com.cs.widgetrv.entity.HomeEntity;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * @ClassName: HomeAdapter
 * @Date: 2021/12/14
 * @Author: CS
 * @Description:
 */
public class HomeAdapter extends BaseSectionQuickAdapter<HomeEntity, BaseViewHolder>{


    public HomeAdapter(@Nullable List<HomeEntity> data) {
        super(R.layout.home_item_view,data);
        addItemType(JSectionEntity.NORMAL_TYPE, R.layout.home_item_view);
        //addItemType(JSectionEntity.HEADER_TYPE, R.layout.def_section_head );
    }


    @Override
    protected void convertHeader(@NotNull BaseViewHolder helper, @NotNull HomeEntity item) {
    }

    @Override
    protected void convert(@NotNull BaseViewHolder helper, HomeEntity item) {
        helper.setText(R.id.text, item.headerTitle);
        helper.setImageResource(R.id.icon, item.imageResource);
    }
}
